<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.js"></script>
  <script src="../js/axios.min.js"></script>
  <script src="../js/api.js"></script>
  <style>
    a {
      text-decoration: none;
    }

    body {
      margin: 0;
      padding: 0;
    }

    div {
      padding: 0;
      margin: 0;
    }

    input {
      padding: 0;
      margin: 0px;
    }

    .top {
      width: 1000px;
      margin: 0 auto;
    }

    .body {
      width: 100%;
      height: 580px;
      position: relative;
    }

    #login {
      width: 320px;
      height: 400px;
      background: white;
      padding: 30px;
      position: absolute;
      top: 30px;
      left: 880px;
    }

    .login_top {
      width: 270px;
      height: 26px;
      margin: 0 auto;

      /* background: red; */
    }

    .login_top>a {
      float: left;
      box-sizing: border-box;
      width: 135px;
      height: 26px;
      line-height: 26px;
      font-size: 20px;
      color: gray;
      text-align: center;
    }

    .login_top>a:nth-child(1) {
      color: #cc5252;
      border-right: 2px solid gray;
    }

    .login_centent {
      margin-top: 15px;
    }

    .login_centent>input {
      width: 300px;
      height: 44px;
      border-radius: 3px;
      border: 1px solid gray;
      text-indent: 5px;
      margin-left: 15px;
      margin-bottom: 20px;
    }

    .login_buttom>div {
      margin-left: 15px;
    }

    .login_buttom>div>a {
      color: #999;
    }

    .login_buttom>p {
      margin-top: 90px;
      float: right;
    }

    .login_buttom>p>a {
      color: #999;
    }

    .login_buttom>p>span {
      color: #999;
    }

    .tottom {
      padding: 50px 0;
      text-align: center;
      font-size: 12px;
      color: #999;
    }
  </style>
</head>

<body>
  <div class="top">
    <a href="#"><img src="../image/logo-icon.png" alt="" /></a>
  </div>
  <div class="body">
    <a href="./index.html">
      <img src="../image/loginbackbround.png" width="100%" alt="" />
    </a>
    <div id="login">
      <div class="login_top">
        <a href="#">会员登陆</a>
        <a href="#">扫码登陆</a>
      </div>
      <div class="login_centent">
        <input type="text" placeholder="手机号/用户名/账号" />
        <input type="text" placeholder="密码" />
        <input type="button" value="立即登录" />
      </div>
      <div class="login_buttom">
        <div>
          <a href="./reg.html">免费注册</a>
        </div>
        <p>
          <a href="#">账户密码</a>
          <span>|</span>
          <a href="#">社交登录</a>
        </p>
      </div>
    </div>
  </div>
  <div class="tottom">
    <p>
      万表网名表商城版权所有2009-2021 ICP备案证书号:粤ICP备09108738号-2
      营业执照 网监备案:4401060103141
    </p>
    <p>广州市万表科技股份有限公司地址:广州市番禺区番禺大道北16号</p>
    <p>Copyright 2009-2021 WwW.WBIAO.CN.LTD ALL RIGHT RESERVED.</p>
  </div>
</body>
<script>
  //      username 用户名
  //      password 密码

  $(".login_centent input:eq(2)").click(() => {
    let username = $(".login_centent input:eq(0)").val();
    let password = $(".login_centent input:eq(1)").val();
    console.log(username, password);
    $.get(loginAPI, { username, password }, function (res) {
      console.log(res);
      localStorage.setItem("wb-uid", res.data.id);
      localStorage.setItem("wb-token", res.data.token);
      localStorage.setItem("wb-name", res.data.username);
      location.href = "./index.html";
    });
  });
</script>

</html>